package kr.saeildamil.androidforstudy2.ch20;

import kr.saeildamil.androidforstudy2.ch20.common.PlanetDescFragment;
import android.app.Activity;
import android.content.res.Configuration;
import android.os.Bundle;

public class PlanetDescActivity extends Activity{
	
	@Override
	protected void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		
		if(getResources().getConfiguration().orientation==Configuration.ORIENTATION_LANDSCAPE){
			finish();
			return;
		}
		
		int index = getIntent().getExtras().getInt("index");
		PlanetDescFragment details = PlanetDescFragment.newInstance(index);
		
		getFragmentManager()
		.beginTransaction().add(android.R.id.content, details)
		.commit();
	}

}
